package Sequence;

import java.util.Arrays;

public class Test0455 {
}

class Solution0455_1 {
    public int findContentChildren(int[] g, int[] s) {
        Arrays.sort(g);
        Arrays.sort(s);
        int i1 = 0;
        int i2 = 0;

        while (i1 < g.length && i2 < s.length) {
            if (s[i2] >= g[i1]) {
                i1++;
            }
            i2++;
        }

        return i1;
    }
}
